package xiangmu.schoolpaper.controller;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import xiangmu.schoolpaper.pojo.DTO.PaperCount;
import xiangmu.schoolpaper.pojo.DTO.SumData;
import xiangmu.schoolpaper.pojo.DTO.TotalRatingCount;
import xiangmu.schoolpaper.result.Result;
import xiangmu.schoolpaper.service.TeacherIndexService;

import java.util.List;


@RestController
@Slf4j
@Tag(name="教师端首页接口数据")
//@RequestMapping("/teacher/index")
public class TeacherIndexController {

    @Autowired
    private TeacherIndexService teacherIndexService;
    @Operation(summary = "获取数据总数")
    @GetMapping("/teacher/index/sumData")
    public Result sumData() {
        log.info("获取论文总数");
        SumData sumData=teacherIndexService.getSumData();
        return Result.success(sumData);
    }
    @Operation(summary = "获取论文数")
    @GetMapping("/teacher/index/paperCount")
    public Result getPaperCount(){
        log.info("获取论文数");
        List<PaperCount> paperCount = teacherIndexService.getPaperCount();
        return Result.success(paperCount);
    }
    @Operation(summary = "获取评价总数")
    @GetMapping("/teacher/index/totalRatingCount")
    public Result getTotalRatingCount(){
        log.info("获取评价总数");
        List<TotalRatingCount> list = teacherIndexService.getTotalRatingCount();
        return Result.success(list);
    }
//    @Operation(summary = "根据关键词和用户输入AI预测关键词热点")
//    @GetMapping("/AiPredictByKeywords")
//    public  Result AiPredictByKeywords(@RequestParam(required = false, defaultValue = "")String query){
//        log.info("根据关键词和用户输入AI预测关键词热点");
//        String guo = teacherIndexService.AiPredictByKeywords(query);
//        return Result.success(guo);
//    }



}
